FROM nginx:alpine
VOLUME /tmp
ENV LANG en_US.UTF-8
RUN echo -e "server {  \n\
            listen       80; \n\
            server_name  localhost; \n\
            location / { \n\
              root   /var/www/html; \n\
              try_files \$uri \$uri/ /index.html; \n\
              index  index.html index.htm; \n\
            } \n\
            location /prod-api/ { \n\
              proxy_set_header Host \$http_host; \
              proxy_set_header X-Real-IP \$remote_addr; \n\
              proxy_set_header REMOTE-HOST \$remote_addr; \n\
              proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \n\
              proxy_pass http://192.168.3.13:8088/; \n\
            } \n\
          }" > /etc/nginx/conf.d/default.conf \
    &&  mkdir  -p  /var/www \
    &&  mkdir -p /var/www/html

ADD dist/ /var/www/html/
EXPOSE 80
EXPOSE 443
